/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.hk.shop.service.shop;

import java.util.List;

import com.thinkgem.jeesite.modules.hk.shop.dao.shop.*;
import com.thinkgem.jeesite.modules.hk.shop.entity.shop.*;
import com.thinkgem.jeesite.modules.hk.sys.dao.user.HkUserDao;
import com.thinkgem.jeesite.modules.sys.dao.UserDao;
import com.thinkgem.jeesite.modules.sys.entity.User;
import com.thinkgem.jeesite.modules.sys.service.SystemService;
import com.thinkgem.jeesite.modules.sys.utils.UserUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;

/**
 * 店铺管理Service
 *
 * @author 李欣荣
 * @version 2018-10-08
 */
@Service
@Transactional(readOnly = true)
public class HkUserShopService extends CrudService<HkUserShopDao, HkUserShop> {

    @Autowired
    private HkEnterShopInfoDao hkEnterShopInfoDao;
    @Autowired
    private HkEnterShopCompanyInfoDao hkEnterShopCompanyInfoDao;
    @Autowired
    private HkShopTrademarkDao hkShopTrademarkDao;
    @Autowired
    private HkShopReviewDao hkShopReviewDao;

    public HkUserShop get(String id) {
        return super.get(id);
    }

    public List<HkUserShop> findList(HkUserShop hkUserShop) {
        return super.findList(hkUserShop);
    }

    public Page<HkUserShop> findPage(Page<HkUserShop> page, HkUserShop hkUserShop) {
        return super.findPage(page, hkUserShop);
    }

    @Transactional(readOnly = false)
    public void save(HkUserShop hkUserShop, String flag) {
        super.save(hkUserShop);
    }

    @Transactional(readOnly = false)
    public void delete(HkUserShop hkUserShop) {
        super.delete(hkUserShop);
    }

    public HkUserShop getShopByUserId(String manageid) {
        HkUserShop hkUserShop = new HkUserShop();
        hkUserShop.setManage(new User(manageid));
        return dao.getShopByUserId(hkUserShop);
    }

    @Transactional(readOnly = false, rollbackFor = Exception.class)
    public void updateById(HkUserShop hkUserShop) {
        dao.updateById(hkUserShop);
    }

    public HkUserShop getShopByUserName(String username){
        return dao.getShopByUserName(username);
    }
}